package org.zxstudio.encrypt.utils;

import java.io.File;
import java.util.Comparator;

public class FileComparator implements Comparator<File> {

	@Override
	public int compare(File lhs, File rhs) {
		if (lhs.isDirectory() && !rhs.isDirectory()) {
			return -1000;
		} else if (!lhs.isDirectory() && rhs.isDirectory()) {
			return 1000;
		}
		return (lhs.getName().toLowerCase()).compareTo(rhs.getName()
				.toLowerCase());
	}

}
